package com.wyh.controlller;

import com.wyh.dao.InsuranceTypeDao;
import com.wyh.entity.InsuranceType;
import com.wyh.struct.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author wangyaohan
 * @Date 2021/9/24 15:30
 * @ClassName InsuranceTypeController
 */
@RequestMapping("inst")
@RestController
@CrossOrigin
public class InsuranceTypeController {

    @Autowired
    private InsuranceTypeDao insuranceTypeDao;

    /**
     * 查询所有保险种类
     *
     * @return
     */
    @RequestMapping("findInsuranceType")
    public Object findInsuranceType() {
        List<InsuranceType> all = insuranceTypeDao.findAll();
        return new PageResult(all, null, null);
    }
}
